const { defineConfig } = require('@vue/cli-service');
const AutoImport = require('unplugin-auto-import/webpack');
const Components = require('unplugin-vue-components/webpack');
const { ElementPlusResolver } = require('unplugin-vue-components/resolvers');

module.exports = defineConfig({
  transpileDependencies: true,
  lintOnSave: false,
  devServer: {
    proxy: {
      '/api': {
        target: 'http://192.168.1.241:8080',
        pathRewrite: {
          '^/api': ''
        },
        changeOrigin: true
      },
      // '/python': {
      //   target: 'http://192.168.1.241:8080',
      //   pathRewrite: {
      //     '^/python': ''
      //   },
      //   changeOrigin: true
      // },
    },
    port: 8088,
    host: '192.168.1.241',
    open: true,
  },
  configureWebpack: {
    plugins: [
      AutoImport({
        resolvers: [ElementPlusResolver()],
      }),
      Components({
        resolvers: [ElementPlusResolver()],
      }),
    ],
  },
});
